export default {
  Store: {
    list: {
      query: {
      },
      list_filter: {
        name: {
          expression: `entity.getName() matches ":value"`,
          label: '中心名称',
          type: 'input'
        }
      },
      list_display: [
        { property: 'user', label: '登录账号' },
        { property: 'name', label: '名称' },
        {
          property: 'headerAgent',
          label: '运营中心分账账号'
        },
        {
          property: 'wineAgent',
          label: '门店补贴账号'
        },
        {
          property: 'status',
          label: '状态',
          component: {
            props: ['data'],
            render(h) {
              return (
                <el-tag>{['停用', '正常'][parseInt(this.data)]}</el-tag>
              )
            }
          }
        }
      ]
    },
    form: {
      fields: [
        {
          property: 'user',
          field_options: { label: '登录账号' }
        },
        'name',
        {
          property: 'headerAgent',
          field_options: { label: '运营中心分账账号' }
        },
        {
          property: 'wineAgent',
          field_options: { label: '门店补贴账号' }
        },
        {
          property: 'status',
          required: true,
          default_value: '1',
          component: {
            props: ['form', 'property'],
            render(h) {
              return (
                <el-select v-model={this.form[this.property]} filterable>{
                  [
                    { label: '正常', value: '1' },
                    { label: '停用', value: '0' }
                  ]
                    .map(status => {
                      return <el-option key={status.value} label={status.label} value={status.value} />
                    })
                }</el-select>
              )
            }
          }
        },
      ]
    }
  }
}

